﻿<%@ Page Title="" Language="VB" MasterPageFile="~/AMLO/MasterPageAMLO.master" AutoEventWireup="false" CodeFile="SearchAmlo1_03.aspx.vb" Inherits="AMLO_SearchAmlo1_03" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
            $("input[id$=txtDateStart]").datepicker($.extend({}, $.datepicker.regional['th'], {
                yearAddToDisplay: 543,
                dateFormat: 'dd/mm/yy',
                showOn: "button",
                buttonImage: "../img/calendar.gif",
                buttonImageOnly: true
            }));

            $("input[id$=txtDateEnd]").datepicker($.extend({}, $.datepicker.regional['th'], {
                yearAddToDisplay: 543,
                dateFormat: 'dd/mm/yy',
                showOn: "button",
                buttonImage: "../img/calendar.gif",
                buttonImageOnly: true
            }));

            function EndRequestHandler(sender, args) {
                $("input[id$=txtDateStart]").datepicker($.extend({}, $.datepicker.regional['th'], {
                    yearAddToDisplay: 543,
                    dateFormat: 'dd/mm/yy',
                    showOn: "button",
                    buttonImage: "../img/calendar.gif",
                    buttonImageOnly: true
                }));

                $("input[id$=txtDateEnd]").datepicker($.extend({}, $.datepicker.regional['th'], {
                    yearAddToDisplay: 543,
                    dateFormat: 'dd/mm/yy',
                    showOn: "button",
                    buttonImage: "../img/calendar.gif",
                    buttonImageOnly: true
                }));

            }

        });

        var hasSubmitted = 0;
        function NoDoubleSubmit() {
            var divMsg = document.getElementById('Processing');
            if (hasSubmitted == 0) {
                hasSubmitted = 0;
                divMsg.style.display = 'block';
                return true;
            }
            return false;
        }

        var prm = Sys.WebForms.PageRequestManager.getInstance();

        prm.add_initializeRequest(InitializeRequest);
        prm.add_endRequest(EndRequest);

        function InitializeRequest(sender, args) {
            $get('ContentPlaceHolder1_UpdatePanel1').style.cursor = 'wait';
        }

        function EndRequest(sender, args) {
            $get('ContentPlaceHolder1_UpdatePanel1').style.cursor = 'auto';
        }


    </script>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table style="width:100%;" >
                <tr>
                    <td align="right" valign="top">
                        <asp:Label ID="lblBranch" runat="server">ส่วนงานสาขา</asp:Label>
                    </td>
                    <td align="left" valign="top">
                        <asp:DropDownList ID="ddlBranch" runat="server" CssClass="control" 
                            Width="200px">
                        </asp:DropDownList>
                    </td>
                    <td align="right" valign="top">
                        <asp:Label ID="lbltransactionDate" runat="server">วันที่ทำธุรกรรม</asp:Label>
                    </td>
                    <td align="left" valign="top">
                        <asp:TextBox ID="txtDateStart" runat="server" CssClass="control" Height="20px" 
                            Width="160px" AutoCompleteType="Disabled"></asp:TextBox>
                    </td>
                    <td align="right" valign="top">
                        ถึง</td>
                    <td align="left" valign="top">
                        <asp:TextBox ID="txtDateEnd" runat="server" CssClass="control" Height="20px" 
                            Width="160px" AutoCompleteType="Disabled"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right" valign="top">
                        <asp:Label ID="lblYear" runat="server">ปี</asp:Label>
                    </td>
                    <td align="left" valign="top">
                        <asp:TextBox ID="txtYear" runat="server" CssClass="control" Height="20px" 
                            Width="100px" AutoCompleteType="Disabled"></asp:TextBox>
                    </td>
                    <td align="right" valign="top">
                        <asp:Label ID="lblNo" runat="server">เลขที่</asp:Label>
                    </td>
                    <td align="left" valign="top">
                        <asp:TextBox ID="txtNo" runat="server" CssClass="control" Height="20px" 
                            Width="160px" AutoCompleteType="Disabled"></asp:TextBox>
                    </td>
                    <td align="right" valign="top">
                        &nbsp;</td>
                    <td align="left" valign="top">
                        &nbsp;</td>
                </tr> 
                <tr>
                    <td align="right" valign="top">
                        สถานะ</td>
                    <td align="left" valign="top">
                        <asp:RadioButtonList ID="rdolIsComplete" runat="server" 
                            RepeatDirection="Horizontal">
                            <asp:ListItem Value="-1">ทั้งหมด</asp:ListItem>
                            <asp:ListItem Value="1">ครบถ้วน</asp:ListItem>
                            <asp:ListItem Value="0">ไม่ครบถ้วน</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                    <td align="right" valign="top">
                        <asp:Label ID="lblDelete" runat="server" Text="สถานะการลบ"></asp:Label>
                    </td>
                    <td align="left" valign="top" colspan="3">
                        <asp:RadioButtonList ID="rdoDelete" runat="server" 
                            RepeatDirection="Horizontal">
                            <asp:ListItem Value="0">ทั้งหมด</asp:ListItem>
                            <asp:ListItem Value="1">ขอลบ</asp:ListItem>
                            <asp:ListItem Value="2">ยืนยันลบ</asp:ListItem>
                        </asp:RadioButtonList>
                        <asp:CheckBox ID="ChkIsDelete" runat="server" Text="ขอลบ" />
                    </td>
                </tr>
                <tr>
                    <td colspan="6" style="text-align: right">
                        <asp:Button ID="btnSearch" runat="server" CssClass="control" Text="ค้นหา" 
                            Width="80px" />
                        <asp:Button ID="btnAdd" runat="server" CssClass="control" Text="เพิ่ม" 
                            Width="80px" />
                        <asp:Button ID="btnEdit" runat="server" CssClass="control" Text="แก้ไข" 
                            Width="80px" />
                        <asp:Button ID="btnDelete" runat="server" Text="ลบ" Width="80px" 
                            CssClass="control" />
                        <asp:Button ID="btnPrint" runat="server" Text="พิมพ์ฟอร์ม" Width="80px" 
                            CssClass="control" />
                    </td>
                </tr>
                <tr>
                    <td colspan="6" style="text-align: center">
                        <asp:Label ID="lblMsg" runat="server" CssClass="control" Font-Bold="True" 
                            Font-Size="XX-Large" ForeColor="Red" Height="35px" Text="ไม่พบข้อมูล" 
                            Visible="False" Width="170px"></asp:Label>
         <SPAN id="Processing" style="DISPLAY: none">
 <img src="../img/icon/ajax-loader.gif" alt="Please wait" />
            กรุณารอสักครู่ ระบบกำลังค้นหาข้อมูล...
  </SPAN>
                    </td>
                </tr>
                <tr>
                    <td colspan="6">
                        <asp:GridView ID="grdAmlo" runat="server" AllowPaging="True" 
                            AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" 
                            style="margin-right: 0px; margin-bottom: 0px;" Width="100%">
                            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                            <Columns>
                                <asp:CommandField ButtonType="Image" 
                                    SelectImageUrl="~/img/icon/select_icon.gif" ShowSelectButton="True">
                                <ItemStyle Width="60px" />
                                </asp:CommandField>
                                <asp:TemplateField HeaderText="VER/SEND">
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# eval("RPTREV") %>'></asp:Label>
                                        <asp:Label ID="Label7" runat="server" Text="/"></asp:Label>
                                        <asp:Label ID="Label8" runat="server" 
                                            Text='<%# iif(eval("ISSEND") =0 ," ","Y") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" Width="80px" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="RPTNO" HeaderText="เลขที่">
                                <ItemStyle HorizontalAlign="Center" Width="80px" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="ชื่อ">
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" 
                                            Text='<%# eval("FirstName") & " " & eval("LastName") %>'></asp:Label>
                                        <asp:HiddenField ID="hdfRptSeq" runat="server" Value='<%# eval("rptseq") %>' />
                                        <asp:HiddenField ID="hdfRptFullNo" runat="server" 
                                            Value='<%# eval("BranchCodeUse") & eval("DEPTCODE") & eval("RPTYEAR") & eval("RPTNO") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="transDate" DataFormatString="{0:d}" 
                                    HeaderText="วันที่ทำธุรกรรม">
                                <ItemStyle HorizontalAlign="Center" Width="100px" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="ชนิดธุรกรรม">
                                    <ItemTemplate>
                                        <asp:Label ID="Label3" runat="server" 
                                            Text='<%# iif(eval("TSCTYPEID")="-","",eval("TSCTYPENAME")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" Width="130px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="ลบ/อนุมัติ">
                                    <ItemTemplate>
                                        <asp:Label ID="Label9" runat="server" Text=" "></asp:Label>
                                        <asp:Label ID="Label10" runat="server" Text=" "></asp:Label>
                                        <asp:Label ID="Label11" runat="server" 
                                            Text='<%# iif(eval("isDelete") =0," ","Y") %>'></asp:Label>
                                        <asp:Label ID="Label6" runat="server" Text="/"></asp:Label>
                                        <asp:Label ID="Label12" runat="server" 
                                            Text='<%# iif(eval("isConfirm") =0," ","Y") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" Width="90px" />
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <PagerSettings Mode="NumericFirstLast" />
                            <PagerStyle BackColor="#FFCC66" CssClass="cssPager" ForeColor="#333333" 
                                HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                            <HeaderStyle BackColor="#FF9933" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
            <div align="right">
                   <asp:Label ID="lblTotal" runat="server" Font-Bold="True" ForeColor="#003300"></asp:Label>
             </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

